<form name="commission_rule_edit_form" class="w620">
    <table width="100%" class="mt10">
        <tbody>
        <tr>
            <td align="right" class="form-cell w120 pt16" valign="top">
                <em class="c-red">*&nbsp;</em> 规则适用身份：
            </td>
            <td class="pt12">
                <div class="p15 b-gray" style="width:445px;">
                    <div class="row clearfix" ng-if="brokerIdentities && brokerIdentities.length>0">
                        <div class="col-md-6" ng-repeat="item in brokerIdentities" ng-if="item.value!='9005' && item.value!='9108' && item.value!='9003' && item.value!='9006'">
                            <label class="checkbox">
                                <input type="checkbox" ng-model="item.selected" ng-change="updateIdentitySelected(item)"/>
                                <span>{{item.name}}</span>
                            </label>
                        </div>
                    </div>
                    <div class="border-bottom pt12"></div>
                    <div class="row clearfix pt12">
                        <div class="col-md-6">
                            <span class="checkbox">
                                <input type="checkbox" id="commission_rule_edit_proxy"
                                       ng-model="proxy_selected"/>
                                <label for="commission_rule_edit_proxy">代理公司</label>
                            </span>
                            <a class="btn" ng-if="!proxy_selected" data-ng-disabled="!proxy_selected">选择公司</a>
                            <a href="javascript: void(0)" class="btn"
                               ng-if="proxy_selected"
                               ui-dialog="选择代理公司"
                               ui-dialog-data="{brokerIdentities:brokerIdentities}"
                               ui-dialog-cache="false"
                               ui-cancel-value="关闭"
                               ui-dialog-ok="selectProxyCompanies($dialog,$dialogScope)"
                               ui-dialog-before-show="selectCompanies.onShowSelectDialog(brokerIdentities, $dialog, $dialogScope,'9003', curProjectId)"
                               ui-dialog-url="inc/dialog/commission_rule_select_company.html">选择公司</a>

                        </div>
                        <ul class="shenfen_check bgcf7 c-gray clearfix" style="clear: both;" ng-if="proxyCompanies && proxyCompanies.length">
                            <li ng-repeat="item in proxyCompanies">
                                {{item.text}}
                                <button i="close" class="ui-dialog-close" title="删除" ng-click="deleteIdentity(item, proxyCompanies)">×
                                </button>
                            </li>
                        </ul>
                    </div>
                    <div class="row clearfix pt12">
                        <div class="col-md-6">
                            <span class="checkbox">
                                <input type="checkbox" id="commission_rule_edit_partner"
                                       ng-model="partner_selected"/>
                                <label for="commission_rule_edit_partner">合作伙伴</label>
                            </span>
                            <a class="btn" ng-if="!partner_selected" data-ng-disabled="!partner_selected">选择公司</a>
                            <a href="javascript: void(0)" class="btn"
                               ng-if="partner_selected"
                               ui-dialog="选择合作伙伴公司"
                               ui-dialog-data="{brokerIdentities:brokerIdentities}"
                               ui-dialog-cache="false"
                               ui-cancel-value="关闭"
                               ui-dialog-ok="selectPartnerCompanies($dialog,$dialogScope)"
                               ui-dialog-before-show="selectCompanies.onShowSelectDialog(brokerIdentities, $dialog, $dialogScope,'9006', curProjectId)"
                               ui-dialog-url="inc/dialog/commission_rule_select_company.html">选择公司</a>
                        </div>
                        <ul class="shenfen_check bgcf7 c-gray clearfix" style="clear: both;" ng-if="partnerCompanies && partnerCompanies.length">
                            <li ng-repeat="item in partnerCompanies">
                                {{item.text}}
                                <button i="close" class="ui-dialog-close" title="删除" ng-click="deleteIdentity(item, partnerCompanies)">×
                                </button>
                            </li>
                        </ul>
                    </div>
                    <div class="row clearfix pt12">
                        <div class="col-md-6">
                            <span class="checkbox">
                                <input type="checkbox" id="commission_rule_edit_intermediary"
                                       ng-model="intermediary_selected"/>
                                <label for="commission_rule_edit_intermediary">中介机构</label>
                            </span>
                            <a class="btn" ng-if="!intermediary_selected" data-ng-disabled="!intermediary_selected">选择公司</a>
                            <a href="javascript: void(0)" class="btn"
                               ng-if="intermediary_selected"
                               ui-dialog="选择中介机构公司"
                               ui-dialog-data="{brokerIdentities:brokerIdentities}"
                               ui-dialog-cache="false"
                               ui-cancel-value="关闭"
                               ui-dialog-ok="selectIntermediaryCompanies($dialog,$dialogScope)"
                               ui-dialog-before-show="selectCompanies.onShowSelectDialog(brokerIdentities, $dialog, $dialogScope,'9108', curProjectId)"
                               ui-dialog-url="inc/dialog/commission_rule_select_company.html">选择公司</a>
                        </div>
                        <ul class="shenfen_check bgcf7 c-gray clearfix" style="clear: both;" ng-if="intermediaryCompanies && intermediaryCompanies.length">
                            <li ng-repeat="item in intermediaryCompanies">
                                {{item.text}}
                                <button i="close" class="ui-dialog-close" title="删除" ng-click="deleteIdentity(item, intermediaryCompanies)">×
                                </button>
                            </li>
                        </ul>
                    </div>
                    <div class="row clearfix pt12">
                        <div class="col-md-6">
                            <span class="checkbox">
                                <input type="checkbox" id="commission_rule_edit_intermediary_company"
                                       ng-model="intermediary_company_selected" />
                                <label for="commission_rule_edit_intermediary_company">中介公司</label>
                            </span>
                            <a class="btn" ng-if="!intermediary_company_selected" data-ng-disabled="!intermediary_company_selected">选择公司</a>
                            <a href="javascript: void(0)" class="btn"
                               ng-if="intermediary_company_selected"
                               ui-dialog="选择中介公司"
                               ui-dialog-data="{brokerIdentities:brokerIdentities}"
                               ui-dialog-cache="false"
                               ui-cancel-value="关闭"
                               ui-dialog-ok="selectIntermediaryCompCompanies($dialog,$dialogScope)"
                               ui-dialog-before-show="selectCompanies.onShowSelectDialog(brokerIdentities, $dialog, $dialogScope,'9005', curProjectId)"
                               ui-dialog-url="inc/dialog/commission_rule_select_company.html">选择公司</a>
                        </div>
                        <ul class="shenfen_check bgcf7 c-gray clearfix" style="clear: both;" ng-if="intermediaryCompCompanies && intermediaryCompCompanies.length">
                            <li ng-repeat="item in intermediaryCompCompanies">
                                {{item.text}}
                                <button i="close" class="ui-dialog-close" title="删除" ng-click="deleteIdentity(item, intermediaryCompCompanies)">×
                                </button>
                            </li>
                        </ul>
                    </div>

                    <div class="text-center" ng-if="!brokerIdentities || brokerIdentities.length==0">
                        暂无身份
                    </div>
                </div>
            </td>
        </tr>
        </tbody>
    </table>
</form>